from flask import Flask, render_template, request, flash
from settings import Config, db
from index_page import index_page
from list_page import list_page
from detail_page import detail_page
from user_page import user_page

app = Flask(__name__, static_url_path='', static_folder='static')

app.config.from_object(Config)         #添加应用设置
db.init_app(app)            #利用设置初始化数据库

app.register_blueprint(index_page, url_prefix='/')
app.register_blueprint(list_page, url_prefix='/')
app.register_blueprint(detail_page, url_prefix='/')
app.register_blueprint(user_page, url_prefix='/')

if __name__ == '__main__':
    app.run(debug=True)